﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ComponentModel;

namespace InstallerBD
{
    /// <summary>
    /// Interaction logic for ShowScriptContent.xaml
    /// </summary>
    public partial class ShowScriptContent : Window, INotifyPropertyChanged
    {
        public ShowScriptContent(IEnumerable<SQLScript> scriptList)
        {
            ScriptsCollection = scriptList;
            InitializeComponent();
            this.DataContext = this;
        }

        public IEnumerable<SQLScript> ScriptsCollection { get; set; }
        public SQLScript _sellectedScript;
        public SQLScript SellectedScript
        {
            get
            {
                return _sellectedScript;
            }
            set
            {
                _sellectedScript = value;
                onPropertyChanged("SellectedScript");
            }
        }
        #region PropertyChanged
        public event PropertyChangedEventHandler PropertyChanged;

        private void onPropertyChanged(string fieldName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(fieldName));
            }
        }
        #endregion
    }
}
